<html>
<head>
<title>Docs for page table.lib.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">Table_library</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                                                                                                                        
                                                  		  [ <a href="../classtrees_Table_library.html" class="menu">class tree: Table_library</a> ]
		  [ <a href="../elementindex_Table_library.html" class="menu">index: Table_library</a> ]
		  	    [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_default.html">default</a><br />
              <a href="../li_Database.html">Database</a><br />
              <a href="../li_Game_library.html">Game_library</a><br />
              <a href="../li_Main.html">Main</a><br />
              <a href="../li_Session_library.html">Session_library</a><br />
              <a href="../li_Table_library.html">Table_library</a><br />
              <a href="../li_User_library.html">User_library</a><br />
            <br /><br />
                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../Table_library/_lib---table.lib.php.html">		table.lib.php
		</a><br>
	  </div><br />
      
      
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Procedural File: table.lib.php</h1>
Source Location: /lib/table.lib.php<br /><br />

<br>
<br>


<h2>Page Details:</h2>
This file holds the library functions for table management.<br /><br /><br /><br />
<h4>Includes:</h4>
<div class="tags">
require_once(<a href="../Database/_lib---db.lib.php.html">"lib/db.lib.php"</a>) [line 10]<br />
require_once(<a href="../default/_conf---game.conf.php.html">"conf/game.conf.php"</a>) [line 11]<br />
</div>
<br /><br />
<br /><br />
<br />
  <hr />
	<a name="functiontable_assoc_game"></a>
	<h3>table_assoc_game <span class="smalllinenumber">[line 275]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_assoc_game(
int $table_id, int $game_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Associate a game with a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$game_id</b>&nbsp;&nbsp;</td>
        <td>Game ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_get_game_id"></a>
	<h3>table_get_game_id <span class="smalllinenumber">[line 319]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_get_game_id(
int $table_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Find game id of a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Table ID</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_get_table_seat_user"></a>
	<h3>table_get_table_seat_user <span class="smalllinenumber">[line 113]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int|FALSE table_get_table_seat_user(
int $table_id, int $seat_number, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Find the user that sat on a seat.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>User ID</strong> if successed, <strong>zero</strong> if seat is empty, <strong>False</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$seat_number</b>&nbsp;&nbsp;</td>
        <td>Seat number.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_get_users"></a>
	<h3>table_get_users <span class="smalllinenumber">[line 248]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>Array table_get_users(
int $table_id, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Get all users sitting in a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>An array holding the user ID of all users.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_get_user_table"></a>
	<h3>table_get_user_table <span class="smalllinenumber">[line 47]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_get_user_table(
int $user_id, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Find the table that the user is sitting in.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Table ID</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_get_user_table_seat"></a>
	<h3>table_get_user_table_seat <span class="smalllinenumber">[line 79]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_get_user_table_seat(
int $table_id, int $user_id, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Find the seat number that the user is sitting on in a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>Table ID</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_initialize"></a>
	<h3>table_initialize <span class="smalllinenumber">[line 20]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void table_initialize(
[int $num_of_tables = GAME_DEFAULT_NUM_OF_TABLE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Initialize the tables.<br /><br /><p>Delete all tables and add back empty tables.</p><br />    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$num_of_tables</b>&nbsp;&nbsp;</td>
        <td>Number of tables to create.(Default: GAME_DEFAULT_NUM_OF_TABLE)</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_remove_game"></a>
	<h3>table_remove_game <span class="smalllinenumber">[line 297]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_remove_game(
int $table_id)</code>
    </td></tr></table>
    </td></tr></table><br />

		Remove a game in a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_sit_down"></a>
	<h3>table_sit_down <span class="smalllinenumber">[line 149]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_sit_down(
int $table_id, int $seat_number, int $user_id, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Seat a user in a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$seat_number</b>&nbsp;&nbsp;</td>
        <td>Seat number. (Should be 1 &lt;= x &lt;= 5)</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_stand_up"></a>
	<h3>table_stand_up <span class="smalllinenumber">[line 196]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_stand_up(
int $table_id, int $seat_number, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Empty a seat in a table.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$table_id</b>&nbsp;&nbsp;</td>
        <td>Table ID.</td>
      </tr>
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$seat_number</b>&nbsp;&nbsp;</td>
        <td>Seat number. (Should be 1 &lt;= x &lt;= 5)</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>
  <hr />
	<a name="functiontable_user_stand_up"></a>
	<h3>table_user_stand_up <span class="smalllinenumber">[line 231]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool table_user_stand_up(
int $user_id, [bool $no_escape = FALSE])</code>
    </td></tr></table>
    </td></tr></table><br />

		Stand up a user.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td><strong>TRUE</strong> if successed, <strong>FALSE</strong> if failed.</td>
  </tr>
</table>
</div>
    <br /><br />
	
    		<h4>Parameters</h4>
    <table border="0" cellspacing="0" cellpadding="0">
		      <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$user_id</b>&nbsp;&nbsp;</td>
        <td>User ID.</td>
      </tr>
		      <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$no_escape</b>&nbsp;&nbsp;</td>
        <td>Indicate whether to escape the variables or not.</td>
      </tr>
				</table>
    	<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
	</div>

        <div class="credit">
		    <hr />
		    Documentation generated on Fri, 06 May 2011 03:43:25 +0000 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>